package com.qyj.spring_boot_02.util;

import java.util.Random;

public class CodeUtil {
    public static String getCode(Integer len){
        String a = "";
        Random random = new Random();
        for (int i = 0; i < len; i++) {
            int i1 = random.nextInt(10);
            a += i1;
        }
        return a;
    }

    public static void main(String[] args) {
        String code = getCode(6);
        System.out.println("code = " + code);
    }
}
